import FieldIdSelect from './FieldIdSelect';

const { FOCUS_PLACEHOLDER } = window.mmComs;
const N = '\n';

export default {
  // 基础类方法
  "setFieldValue": {
    Component: ({ coms, onChange }) => (
      <FieldIdSelect ecId={`${this && this.props && this.props.ecId || ''}_FieldIdSelect@g06hzo`}
        coms={coms}
        onChange={onChange}
      />
    ),
    handler: value => {
      return `EdcForm.setFieldValue("${value}", "${FOCUS_PLACEHOLDER}");`;
    }
  },

  "getFieldValue": {
    Component: ({ coms, onChange }) => (
      <FieldIdSelect ecId={`${this && this.props && this.props.ecId || ''}_FieldIdSelect@iyj99l`}
        coms={coms}
        onChange={onChange} 
      />
    ),
    handler: value => {
      return `EdcForm.getFieldValue("${value}");${FOCUS_PLACEHOLDER}`;
    },
  },

  "getUrlParamValue": {},

  // 事件类方法
  "domLoad": {},

  "fieldValueChange": {
    Component: ({ coms, onChange }) => (
      <FieldIdSelect ecId={`${this && this.props && this.props.ecId || ''}_FieldIdSelect@4mple9`}
        coms={coms}
        onChange={onChange} 
      />
    ),
    handler: value => {
      return `EdcForm.bindEvent("fieldValueChange", "${value}", function(fieldId, value){${
        N}    ${FOCUS_PLACEHOLDER}${
        N}});`;
    }
  },

  "onSubmit": {},
  
};